package com.mimiwang.comment.vo;

import com.alibaba.fastjson.annotation.JSONField;
import com.alibaba.fastjson.serializer.SerializerFeature;
import com.mimiwang.comment.entity.Comment;
import com.mimiwang.common.entity.user.UserInfoEntity;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.ToString;

import java.util.ArrayList;
import java.util.List;

/**
 * @AUTHOR:游李滨
 * @DATE:2023/5/2 16:29
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
public class CommentVo {

    private Comment comment;
    private UserInfoEntity sender;
    private UserInfoEntity receiver;
    @JSONField(serialzeFeatures= {SerializerFeature.WriteNullListAsEmpty})
    private List<CommentVo> child;

    public CommentVo(Comment comment, UserInfoEntity sender, UserInfoEntity receiver) {
        this.comment = comment;
        this.sender = sender;
        this.receiver = receiver;
        this.child=new ArrayList<>();
    }
}
